
		
project, uses(../data_output/termlimited.dta)

	*** variables: sponsored, log sponsor, committees, vice chairs, leader
	***			   floor votes, cvp, vote with party
	

	

	use ../data_output/termlimited.dta, clear

	
	reghdfe pc1 termlimited  , absorb(CandId chamber_term )  cluster(CandId) keepsingletons 
	local r1 = _b[termlimited]
	local se1 = _se[termlimited]
	local n1 = e(N)
	local l1 = e(N_clust)
	qui sum pc1 if e(sample)
	local m1 =  abs(r(mean))
	local sd1 = r(sd)		
		
	reghdfe pc1 termlimited  , absorb(CandId chamber_party_term ) cluster(CandId)  keepsingletons
	local r2 = _b[termlimited]
	local se2 = _se[termlimited]
	local n2 = e(N)
	local l2 = e(N_clust)
	qui sum pc1 if e(sample)
	local m2 =  abs(r(mean))
	local sd2 = r(sd)	
	
	


	
	cap log close
	quietly {
	
		set linesize 255
		log using "../tables_figures/productivity.tex", text replace
		
		noisily dis "\begin{table}[t]"
		noisily dis "\centering"
		noisily dis "\caption{\textbf{Effect of Electoral Incentives on Legislator Productivity.}"
		noisily dis "In their final term, term-limited legislators are less productive. \label{tab:productivity}} "
		noisily dis "\begin{tabular}{l cc}"
		noisily dis "\toprule\toprule \\[2mm] "
		noisily dis " & \multicolumn{2}{c}{ Legislative } \\ "
		noisily dis " & \multicolumn{2}{c}{ Productivity Index} \\ "
		noisily dis	" \cmidrule(lr){2-3}  \\ "
		noisily dis "& (1) & (2)  \\[1mm]"
		noisily dis "\midrule"
		noisily dis " Term Limited  & " %4.2f `r1' " & " %4.2f `r2'   "\\"
		noisily dis "  & (" %4.2f `se1' ") & (" %4.2f `se2' ")   \\[1mm]"
		noisily dis "\midrule "
		noisily dis " N & " %8.0fc `n1' " & " %8.0fc `n2'    "\\"
		noisily dis " Legislators & " %8.0fc `l1' " & " %8.0fc `l2'     "\\"
		noisily dis " Outcome Mean  & " %4.2f `m1' " & " %4.2f `m2'     "\\"
		noisily dis " Standard Dev.  & " %4.2f `sd1' " & " %4.2f `sd2'     "\\"

		noisily dis "Legislator FE        		 & Yes  & Yes   \\"
		noisily dis "Chamber-Year FE 	  		 & Yes  & 	   \\"
		noisily dis "Chamber-Party-Year FE		 & 	 	& Yes     \\"
		noisily dis "\bottomrule \bottomrule\\[-4mm]"
		noisily dis "\multicolumn{3}{p{.5\textwidth}}{\footnotesize "
		noisily dis " In all columns the outcome variable is the first principal component from a PCA of the three measures of effort."
		noisily dis "The unit of observation is a legislator. The variable Term Limited is a dummy variable indicating if a legislator is in her final, term-limited term."
		noisily dis "Robust standard clustered by legislator in parentheses.}"
		noisily dis "\end{tabular}"
		noisily dis "\end{table}"
	
		
		log off
	
	}
		
	
	
	
	
